// @ts-ignore
/* eslint-disable */
import request from "../request";

/** 新增 POST /doc/create */
export async function create(
  body: API.Article,
  options?: { [key: string]: any }
) {
  return request<API.CommonResultLong>("/doc/create", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除 DELETE /doc/delete */
export async function deleteUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUsingDELETEParams,
  options?: { [key: string]: any }
) {
  return request<API.CommonResultBoolean>("/doc/delete", {
    method: "DELETE",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 详情 GET /doc/get */
export async function get(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: { id: string },
  options?: { [p: string]: any },
) {
  return request<API.CommonResultArticle>("/doc/get", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分页 POST /doc/list */
export async function getPage(
  body: API.ArticlePageQuery,
  options?: { [key: string]: any }
) {
  return request<API.CommonResultPageResponseArticlePageReqVO>("/doc/list", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改 PUT /doc/update */
export async function update(
  body: API.Article,
  options?: { [key: string]: any }
) {
  return request<API.CommonResultBoolean>("/doc/update", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
